<div
  v-loading="isPageLoading"
  :class="[$store.state.appPrefix + '-p-edit-org', 'g-edit-layout']">
  <div class="info-header">
    <i class="el-icon-arrow-left" @click="$router.go(-1)"></i>
    <template v-if="isDetail">企业详情</template>
    <template v-else-if="isEdit">编辑企业</template>
    <template v-else>新增企业</template>
  </div>
  <div class="edit-content">
    <el-form
      class="con-inner is-normal"
      label-position="left"
      label-suffix="："
      label-width="100px"
      ref="basicForm"
      :disabled="isDetail"
      :rules="rules"
      :model="basicForm">
      <el-form-item label="企业码" prop="companyCode">
        <el-input :disabled="isEdit" size="small" v-model="basicForm.companyCode" />
      </el-form-item>
      <el-form-item label="企业名称" prop="companyName">
        <el-input size="small" v-model="basicForm.companyName" >
        </el-input>
      </el-form-item>
      <el-form-item label="系统logo"  class="cover-item" prop="companyLogo">
        <el-upload
          size="small"
          ref="annexUpload"
          class="avatar-uploader"
          :disabled="isDetail"
          :accept="fileMimeType[3]"
          :show-file-list="false"
          :on-change="$handleBgmUrlChange"
          :auto-upload="false">
          <img
            v-if="basicForm.companyLogo"
            class="avatar"
            :src="`${resourceUrl}${basicForm.companyLogo}`"/>
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div slot="tip" class="el-upload__tip">限png格式，大小不超过1MB，建议上传尺寸750*128px</div>
        </el-upload>
        <!-- <el-upload
          class="el-form-item__include-upload--right"
          :disabled="isDetail"
          :accept="fileMimeType[3]"
          :show-file-list="false"
          :on-change="$handleBgmUrlChange"
          :auto-upload="false">
          <el-button type="primary" :disabled="isDetail">选择图片上传</el-button>
        </el-upload> -->
      </el-form-item>
      <el-form-item label="系统名称" prop="companySysName">
        <el-input size="small" v-model="basicForm.companySysName" >
        </el-input>
      </el-form-item>
      <el-form-item label="授权功能" prop="funIds">
        <el-checkbox-group
          size="small"
          v-model="basicForm.funIds"
          @change="$handleChangeOrg">
          <el-checkbox
            v-for="item in Object.keys(projectList)"
            :label="item"
            :key="item">{{projectList[item]}}</el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="授权人数" prop="isLimitNums">
        <el-radio size="small" v-model="basicForm.isLimitNums" label="0">无限制</el-radio>
        <el-radio size="small" v-model="basicForm.isLimitNums" label="1">
          <el-input-number :disabled="basicForm.isLimitNums === '0'" v-model="basicForm.authCount" width="100" :min="1" :max="99999999" label="人数"></el-input-number> 人
        </el-radio>
      </el-form-item>
      <el-form-item label="授权期限" prop="useLimit">
        <el-radio size="small" v-model="basicForm.useLimit" label="0">无限制</el-radio>
        <el-radio size="small" v-model="basicForm.useLimit" label="1">
          <el-date-picker size="small" :disabled="basicForm.useLimit === '0'" v-model="basicForm.deadlineTime" type="date" placeholder="选择截止日期"></el-date-picker>
        </el-radio>
      </el-form-item>
      <el-form-item label="授权状态" prop="enabled">
        <el-radio size="small" v-model="basicForm.enabled" v-for="item in ENABLED_STATUS" :key="item.codeNum" :label="item.codeNum">{{ item.codeName }}</el-radio>
      </el-form-item>
      <template v-if="isDetail">
        <el-form-item label="创建人" prop="createBy">{{ basicForm.createBy }}</el-form-item>
        <el-form-item label="创建时间" prop="createTime">{{ basicForm.createTime }}</el-form-item>
      </template>
    </el-form>
  </div>
  <div class="action-box">
    <el-button size="small" @click="$router.go(-1)">返回</el-button>
    <el-button size="small" v-if="!isDetail" @click.native="$saveForm" type="primary">保存</el-button>
  </div>
</div>
